package com.fzx.fzwsupplysystem.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.Window;
import android.widget.TextView;

import com.fzx.fzwsupplysystem.R;

/**
 * 项目：FzwSupplySystem
 * 创建人：FangZhiXin
 * 时间：2019/11/14 14:24
 * 描述：
 */
public class LoadingViewDialog extends Dialog {

    private TextView tv_note;

    public LoadingViewDialog(@NonNull Context context) {
        super(context);
    }

    public LoadingViewDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected LoadingViewDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.dialog_loading_view);
        Window window = getWindow();
        if (window != null) window.setBackgroundDrawableResource(android.R.color.transparent);
        this.setCanceledOnTouchOutside(false);
        tv_note = findViewById(R.id.dialog_loading_tv);
    }

    public void setTextLoad(String context) {
        if (null != tv_note) {
            tv_note.setText(context);
        }
    }
}
